package server

import (
	"net/http"

	"github.com/gorilla/mux"
)

type RouterGroup struct {
	router *mux.Router
}

// GET registers a new GET route for a path with matching handler in the router.
func (r *RouterGroup) GET(path string, h http.HandlerFunc) {
	r.router.HandleFunc(path, h).Methods(http.MethodGet)
}

// HEAD registers a new HEAD route for a path with matching handler in the routerGroRouterGroup.
func (r *RouterGroup) HEAD(path string, h http.HandlerFunc) {
	r.router.HandleFunc(path, h).Methods(http.MethodHead)
}

// POST registers a new POST route for a path with matching handler in the routerGroRouterGroup.
func (r *RouterGroup) POST(path string, h http.HandlerFunc) {
	r.router.HandleFunc(path, h).Methods(http.MethodPost)
}

// PUT registers a new PUT route for a path with matching handler in the routerGroRouterGroup.
func (r *RouterGroup) PUT(path string, h http.HandlerFunc) {
	r.router.HandleFunc(path, h).Methods(http.MethodPut)
}

// PATCH registers a new PATCH route for a path with matching handler in the routerGroRouterGroup.
func (r *RouterGroup) PATCH(path string, h http.HandlerFunc) {
	r.router.HandleFunc(path, h).Methods(http.MethodPatch)
}

// DELETE registers a new DELETE route for a path with matching handler in the routerGroRouterGroup.
func (r *RouterGroup) DELETE(path string, h http.HandlerFunc) {
	r.router.HandleFunc(path, h).Methods(http.MethodDelete)
}

// CONNECT registers a new CONNECT route for a path with matching handler in the routerGroRouterGroup.
func (r *RouterGroup) CONNECT(path string, h http.HandlerFunc) {
	r.router.HandleFunc(path, h).Methods(http.MethodConnect)
}

// OPTIONS registers a new OPTIONS route for a path with matching handler in the routerGroRouterGroup.
func (r *RouterGroup) OPTIONS(path string, h http.HandlerFunc) {
	r.router.HandleFunc(path, h).Methods(http.MethodOptions)
}

// TRACE registers a new TRACE route for a path with matching handler in the routerGroRouterGroup.
func (r *RouterGroup) TRACE(path string, h http.HandlerFunc) {
	r.router.HandleFunc(path, h).Methods(http.MethodTrace)
}
